import { defineMock } from 'vite-plugin-mock-dev-server'
export default defineMock([
  {
    url: '/api/login',
    body: {
      success: true,
      data: {
        accessToken: 'eyJhbGciOiJIUzUxMiJ9.admin',
        refreshToken: 'eyJhbGciOiJIUzUxMiJ9.adminRefresh',
        expires: '2030/10/30 00:00:00'
      }
    }
  },
  {
    url: '/api/user/info',
    body: {
      success: true,
      data: {
        avatar: 'https://avatars.githubusercontent.com/u/44761321',
        username: 'admin',
        nickname: '小铭',
        // 一个用户可能有多个角色
        roles: ['admin'],
        // 按钮级别权限
        permissions: ['*:*:*']
      }
    }
  }
])
